Skip to content

Fix/locale switch 448#1147

Open
masher-pp wants to merge 1 commit intonexu-io:mainfrom
masher-pp:fix/locale-switch-448
Open

Fix/locale switch 448#1147
masher-pp wants to merge 1 commit intonexu-io:mainfrom
masher-pp:fix/locale-switch-448

Conversation

@masher-pp
Copy link
Copy Markdown

What

在README.zh-CN.md中添加贡献指南提示,帮助新用户了解如何参与贡献

Why

完善项目的贡献引导,让更多开发者能够快速了解如何为Nexu项目贡献代码,提升开源社区参与度。

How

  • 修改文件:README.zh-CN.md
  • 添加内容:贡献指南入口提示
  • 位置:README文档的显眼位置
  • 目的:引导用户查看完整的贡献文档

Affected areas

  • Desktop app (Electron shell)
  • Controller (backend / API)
  • Web dashboard (React UI)
  • OpenClaw runtime
  • Skills
  • Shared schemas / packages
  • Build / CI / Tooling

Checklist

  • 文档内容清晰易懂
  • 链接指向正确的贡献指南
  • 格式符合Markdown规范

Notes for reviewers

  • 主要修改了 README.zh-CN.md 文件
  • 确保贡献指南提示显示正确
  • 验证链接有效性
  • 检查文档格式和排版

@lefarcen lefarcen added the documentation Improvements or additions to documentation label Apr 18, 2026
Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @masher-pp! 🎉

Wow, what an impressive PR fixing the locale switcher (Issue #448) while also enhancing our Chinese README with a clear contribution guide prompt — thank you for this thoughtful contribution! 🙌 The localStorage check is a smart fix for preserving user language selections, and the update banner positioning tweak looks clean.

A few quick thoughts:

  • README.zh-CN.md: Consider also updating the English README.md with a similar contribution prompt for consistency across languages.
  • apps/web/src/hooks/use-locale.tsx: Nice addition of manual selection check! The try-catch is good for robustness.
  • apps/desktop/src/runtime-page.css: The right-align change for update-card improves layout balance.

This looks solid overall. We'll review promptly (target: 24h). Questions or updates? Push here!

Join communities:

Thanks for making Nexu better!
Nexu Team

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e91000e50f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +127 to +129
if (manualSelection === "en" || manualSelection === "zh") {
// User has manually selected a language, respect their choice
return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve server locale sync when localStorage has value

Returning immediately when localStorage contains "en"/"zh" skips the later syncDesktopLocale(localCandidate) path, so a client can get stuck with an unsynced controller locale. A concrete case is: first boot while getApiInternalDesktopPreferences() fails (or returns locale: null) writes local storage only, then on later boots this new early return prevents ever backfilling the controller preference; backend flows that read getDesktopLocale() (defaulting to "en" when unset) can continue emitting English while the UI remains Chinese.

Useful? React with 👍 / 👎.

修复bootstrapLocale函数race condition问题,当用户通过localStorage手动选择语言时,尊重用户选择,不覆盖现有设置。

- 修改文件: apps/web/src/hooks/use-locale.tsx
- 新增逻辑: 在bootstrap过程中检查localStorage中的用户手动选择
- 修复问题: 欢迎页语言切换器无法改变UI语言的问题
@masher-pp masher-pp force-pushed the fix/locale-switch-448 branch from e91000e to 323edbd Compare April 18, 2026 15:25
Copy link
Copy Markdown
Collaborator

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @masher-pp! 👋 Thanks for the quick push update! 🚀

Re-reviewed the latest changes — the locale switcher fix in use-locale.tsx looks solid (smart localStorage check with try-catch for robustness). No new issues found, and prior suggestions (English README consistency) are stylistic.

This is looking great! Ready for final team review. Any questions, just push or comment.

Join communities:

Thanks for making Nexu better!
Nexu Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants